(This document was written in Geneva 9 and Courier 10)
What does this do?
Ñ The other day, I was looking for an application that could give me quick information about GIF files without viewing each one. (The image itself is sometimes not important...) Information such as such as size, whether it is interlaced and such. The GIF format is still the preferred format when using images in Netscape or Mosaic. The only problem was that I could not find a suitable application for the Macintosh. Fortunately, I found some code on the Net that did most of what I was looking for. Unfortunately, this was written for command line systems. Fortunately again, I am not completely new to Macintosh programming and I decided to build some interface around it. This is the result of my efforts. If I have a need for something like this, there must be more people that could use it. So, I decided to release it. I have been working on it for a while now and since the first version many things have changed. Since the previous version (1.7), this is new:
- Rewrote the main part of the application to make it a real Mac application, it does not use the ANSI libraries any more. This saved about 20k in the final version. Drawback is that the application is slower for real big GIF files if you want to see all the info.
- Now also handles JPEG files but only if the file has a Macintosh type of ╘JPEG╒ or ╘JFIF╒ and, of course the colours cannot be shown for these files.
- Redesigned the Preferences dialogue, it not only looks better, it should be more logical as well. Added some options: you can now generate HTML tags with the enclosing folder name added to it automatically.
- HTML tags are now copied to the clipboard for all files that are dragged into the main window (except when the application is in the background, this is a limitation of MacOS).
- Rewrote the About box (the only place where you can do something cool in most applications!) and extended the credits.
How to use it?
Ñ Real simple, just select the file (or files) that you want this information for, and drag them on the application icon. What the result could be is shown here:
╩
The official GIF specs are available on the Apprentice 2 CD or on CompuServe. Most useful are (for me) the version (GIF87 or GIF89A), the image width and height, the number of colours, whether the GIF is interlaced or not and the comments. The transparent colour in this example is colour number 2 which is FED300 in hexadecimal. If you like, you can copy output from this application to paste in elsewhere, or you can drag parts out of the window if you have System 7.5 or Drag and Drop. (The HTML specification would be most useful in this respect I think). You have several options for the format of the HTML tag, set this in Preferences. Apparently, Netscape displays images faster if you use the HEIGHT and WIDTH with the IMG tag and if pictures are not loaded, the viewer can still see the size of the images. The ALT is added so Lynx users (like myself on occasion) don╒t get the word [IMAGE] all over their screen. You can also save the output in a text file.
Usage tip
This thing can be used as a general HTML helper! If you resize the window so that it shows at the bottom of your screen and choose only show HTML stuff in the preferences, you can drag files into the window (and use it as some sort of drop-pad) and easily copy or drag out the HTML tags to your HTML document, of course if you have the thing set to automatically copy the tags, it is even easier. If you prefer to have only a few applications open at a time, choose to quit after processing the files. You can drag files onto the GifScan icon in the Finder and HTML tags will be generated for all files and all tags are automatically copied to the clipboard. A progress bar will be shown if more than 5 files are dropped.
The menus
Ñ Under the File menu:
- Open... : Open a file through the standard file selection dialogue.
- Hide/Show: Hides or shows the window.
- Save As... : Save output to text file.
- Preferences...: Here you can set if your preferences, please refer to the next section.
- Quit : Do I really have to say what you can do with this?
Ñ Under the Edit menu:
- All standard stuff, undo doesn╒t work and would not be very useful...
The Preferences
Ñ The Preferences window is shown here (with the default settings):
╩
Copy HTML Tag to Clipboard automatically: Automatically copies the determined HTML tags to the Clipboard.
Quit after processing files. This option only works if files are dragged on the application and if the application was not already running. It just processes all files dropped on the application icon in the Finder, copying all HTML tags to the clipboard and then quits.
Just show HTML info and forget the rest. You can opt to only show the HTML stuff in the window and forget about the rest.
Prompt to save text files at close. If this is checked, you get the option to save the data to a text file, not very useful so it is turned of by default.
Generate HTML HREF for non-GIF files. If this is checked, a HTML tag will be generated for non-GIF files. The form is then <A HREF=╙NameOfFile>NameOfFile</A>. This will also be copied to the clipboard, if the topmost option is checked.
Use nothing in front of filename. If you select this, the HTML stuff will only show the filename. You can also choose to use full pathnames, the enclosing folder or something that you want (this can be useful if you design pages for use on other systems where all pictures are placed in one directory). You can also select a folder name to put there, if you don╒t feel like typing something. A directory delimiter as shown in the next popup menu will be put after this text if you have used the folder button.
Put <BR> and/or <P> after HTML tag. Gives you the option to set a line feed or paragraph break after the generated HTML specification.
Use WIDTH/HEIGHT or HEIGHT/WIDTH. Someone requested this, so here it is. It just changes the order within the HTML tag.
Show info for all colours (Hexadecimal, Decimal, Percentages). If you have this option turned on, you will get a table showing all available colours in the GIF file in hexadecimal, decimal or percentages RGB. If you turn this off, you get all the info without the colour table.
The font and size popup menus are used to set the font and size to use in the main window.
The help symbol at the bottom can be used to turn on Balloon Help which is available for every item in the window. (Thanks to Peter Lewis╒ Perl script, this is not very hard at all).
About the source code
Ñ You can get the source code to this application at the URL: http://wwwtg.mp.tudelft.nl/~marcb/GifScan. I assembled the original version using DropUnix 1.1 (which is DropShell 2.0 by Leonard Rosenthal et. al., adapted to easily port command line applications to Macintosh, by Ryan Davis) and the source code gifscan.c, written by James D. Murray (in 1989 I think!). Over time, I have added a lot more features, I have used StandardGetFolder 2.0 which was written by Chris Larson, Aaron Giles╒ JPEG Library and a whole lot of other fine examples, see the about box for more credits if you are interested. I wrote it using MetroWerks 7.0 (C Compiler version 1.3., I only have the 68k version) on a Macintosh Quadra 630 8/1200 and a Powerbook 5300. My access to different machines is limited, so if you have a machine or System that it doesn╒t work on, I apologise in advance.
What does it cost me?
Ñ Absolutely nothing! Well, an e-mail, a postcard or money is always a nice gesture. However, this also implies that I, the author, cannot be held responsible for any damages that are a result of using this application. If you use the source yourself, you can blame me for any errors, although I have used other people╒s code, it is also modified so any errors come from me and not the people that wrote the originals. I can╒t imagine what could go wrong except for an occasional crash or freeze, which is easily cured by a simple restart and absolutely no reason for panic (remember that this is free software!).
Version History
1.0 - Initial release.
1.01 - Added the HTML specification so all HTML authors can easily paste this in your HTML IMG specification. (by special request of Dave Grossman).
- You can now hold down the command key to show the colour codes if you have turned this feature off in the Preferences.
1.5 - Doesn╒t use the SIOUX window anymore, Drag and Drop aware (by special request of Paul Constantine). Changed command key down behaviour to toggle between show codes and not, depending on the preference settings.
1.6 - Added option to show only the filename, instead of the full pathname, in the HTML tag.
- You can change the default font (both by special request by Snorre Milde).
- Added the option to save the HTML tag to the Clipboard by default.
- Apparently, 1.5 did not run on systems that did not have Drag and Drop installed. Now fixed, I hope.
1.7 - Now HTML tags for all files dropped on the application are copied instead of the last one alphabetically.
- GifScan now gives you any present GIF comments and the transparent colour, if present in the file.
- GifScan now optionally creates HREFs for all files dropped on it, even non GIF files.
- You can set the option of putting <BR> and/or <P> after the generated HTML tags.
- You can set it to use WIDTH - HEIGHT or HEIGHT - WIDTH. This way you will not make a mistake when you want to do things in Photoshop when generating a new file.
- More bug fixes and options for the output.
- Source code is no longer included in the archive to keep the size down and not too many people needed it anyway, you can still get it at my WWW page (address is given below). (thanks Snorre Milde, Valentin Richter, James Walker and Jonas Nilson).
1.8 - See above.
Thanks to all of you that have sent me email to improve this application. It is really appreciated.
Future plans
What more would you like to see in this application? Please send suggestions, on the list are now:
Ñ Support for things like ALIGN and BORDER in the generated HTML tags.
Known problems
I think most of it works ok. I dumped some 350 files (a mix of small images and some other files) on it at once while testing and it worked perfect, took about 2 minutes to process. The clipboard cannot be changed while the application is in the background, this is why you can╒t put the application in the background while processing files. Any problems, please let me know.
About the author
Ñ For questions and bug reports, you can send e-mail to:
You can also visit my web page at: http://wwwtg.mp.tudelft.nl/~marcb. I have left the university, so this page will probably go away, I don╒t know when but I will try to get a different address if it does and a link to that new page will be given on the old page.
I will be moving to Great Britain shortly, so if you send me email you may not get an answer soon. I will try to get back to you whenever I get some time (and an Internet provider...,if the company doesn╒t have it).